Skip to content

[SDK-873] iOS: install Iterable's iOS SDK through SPM (spm_dependency) - #947

Open
joaodordio wants to merge 5 commits into
masterfrom
cursor/spm-dependency-ios-sdk-ad5a
Open

joaodordio wants to merge 5 commits into
masterfrom
cursor/spm-dependency-ios-sdk-ad5a

Conversation

@joaodordio

@joaodordio joaodordio commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Warning

Targets 4.1.0. 4.0.0 is published (npm latest, tag 4.0.0 at 221e1fd, the base of this PR) and still uses the Iterable-iOS-SDK 6.7.5 pod from CocoaPods trunk. 4.1.0 is the release that moves to SPM and Xcode 26. This is a breaking change shipped as a minor release by product decision. The CHANGELOG entry is under ## Unreleased > Breaking changes; the release PR renames the heading and bumps the version, as usual. Ship it together with the Expo plugin release from iterable-expo-plugin#78, whose peer range ^3.0.0 || ^4.0.0 already covers 4.1.0.

📝 Summary

iOS: pull Iterable's iOS SDK through SPM with React Native's spm_dependency instead of the frozen Iterable-iOS-SDK CocoaPods trunk pod.

🎟️ Jira Ticket: SDK-873

📖 Description

CocoaPods trunk went read-only on 2026-12-02, so Iterable-iOS-SDK 6.7.5 is the last version that will ever be published there. Every RN and Expo iOS app gets the native SDK through this podspec. Without this change RN can never pick up another iOS SDK release.

What changed:

  • Iterable-React-Native-SDK.podspec: s.dependency "Iterable-iOS-SDK", "6.7.5" becomes spm_dependency(s, url: "https://github.com/Iterable/iterable-swift-sdk.git", requirement: { kind: "exactVersion", version: "6.7.5" }, products: ["IterableSDK"]). 6.7.5 is still the latest iOS SDK tag. The native version stays pinned exactly, the same as before and the same as the Flutter plugin (exact: "6.7.5"), so each RN release stays on a tested iOS SDK version.
  • ios/RNIterableAPI/RNIterableAPI.mm: drop #import <IterableSDK/IterableSDK.h>. That was the pod's umbrella header, it only declared two unused version symbols, and SPM Swift targets don't ship it.
  • .github/workflows/ci.yml (build-ios) and .github/workflows/codeql.yml (Swift): Xcode 16.4 becomes Xcode 26.0 (see "Xcode 26+ is required" below).
  • .gitignore: ignore Package.resolved, the same policy as Podfile.lock.
  • README, example README, example Podfile comment and CHANGELOG: migration notes and the Xcode 26 requirement. The Xcode 27 note no longer blames Iterable's pod resource bundle.

spm_dependency ships in React Native 0.75 and later (scripts/cocoapods/spm.rb, absent in 0.74). The remote URL code path is the same from 0.77.3 to 0.85.3. Our documented floor is already 0.77, so this adds no new constraint, and the peer range is unchanged.

Not in this PR: Android 3.11.2 is now on Maven Central, but android/build.gradle still pins 3.10.1. Bump it separately if the next release should carry it.

Customer migration in 4.1.0 (also in CHANGELOG under Unreleased > Breaking changes)

  • Xcode 26+ is required. Xcode 16.4 passes the package's IterableSDK.o to libtool twice for the static RN pod (once through the link file list, once as an explicit input), so the archive holds two copies and -ObjC makes the app link fail with duplicate IterableSDK symbols. A CI probe of every Xcode on the macos-15 runner found:
    • 16.4 adds it twice.
    • 26.0, 26.0.1, 26.1, 26.1.1, 26.2, 26.2.0, 26.3 and 26.3.0 add it once.
    • Adding an explicit Frameworks build file does not help on 16.4.
  • Remove any pod 'Iterable-iOS-SDK' from app targets. A leftover one fails the build with Redefinition of module 'IterableSDK' (verified), so it can't silently link a second copy.
  • use_frameworks! :linkage => :dynamic is no longer required. pod install prints RN's [SPM] WARNING!!! about static linking unless USE_FRAMEWORKS=dynamic; on Xcode 26+ the SDK is linked once, so the warning doesn't apply.
  • Objective-C++ AppDelegate.mm files that #import <IterableSDK/IterableSDK-Swift.h> no longer compile, because that header only existed in the CocoaPods framework. Swift and plain ObjC .m with @import IterableSDK; work.
  • A Notification Service Extension still on pod 'Iterable-iOS-AppExtensions' keeps building (verified) but stays on 6.7.5. Moving it to the IterableAppExtensions SPM product needs a dependency rule that allows RN's pinned version, because Xcode resolves one version per workspace.
  • Builds need network access to github.com to resolve the package (CI caches should include SourcePackages).
  • Expo needs the plugin release from iterable-expo-plugin#78 (the first version after 1.1.x). Plugin 1.1.x and earlier lack the include path, and without it ExpoAdapterIterable fails with no such module 'IterableSDK'.

🧪 How to test?

cd example/ios && pod install && cd .. && yarn ios. The pod install output should include [SPM] Adding product dependency IterableSDK to Iterable-React-Native-SDK, and the package should resolve to 6.7.5.

Verified locally on Xcode 27.2 (simulator, iOS 26.5 runtime):

App Arch Linkage Result
example, RN 0.85.3 New static libraries (default) builds, runs, Iterable.initialize succeeds, API calls go out
example, RN 0.85.3 New use_frameworks! static builds, runs
example, RN 0.85.3 New use_frameworks! dynamic builds, runs, one copy of SDK classes
fresh app, RN 0.77.3 Legacy use_frameworks! dynamic builds, runs, Swift AppDelegate import IterableSDK OK, JS init OK
fresh app, RN 0.77.3 New static libraries builds, ObjC .m @import IterableSDK; OK
Expo 55 / RN 0.83.2 New all three builds with the companion plugin PR

In every case the app embeds IterableSDK_IterableSDK.bundle (nibs, Core Data model, privacy manifest).

CI on head 154177c0 (CHANGELOG-only change since 67e13952): every check passes except CodeQL Swift, which was still running when this was written. It passed on 67e13952. build-ios (Xcode 26.0.1) did a real build with no turbo cache reuse: SPM was added to Pods, the app linked, and there were zero duplicate symbols. CodeQL Swift (Xcode 26.0.1) passes too. JS: yarn test (42 suites, 680 tests), yarn typecheck and yarn lint all pass.

Not verified: a physical device, and rich push delivery to an NSE (the simulator can't authorize notifications without UI automation).

Overlap: open #881 edits the same CodeQL job in codeql.yml, so expect a one-line conflict on whichever merges second.

Unrelated pre-existing issue: the example app has no UIApplicationSceneManifest, so it aborts at launch on the iOS 27 simulator (UIKit scene-lifecycle enforcement). It does this with or without this change.

🧾 Changelog

Added under ## Unreleased > Breaking changes, for 4.1.0.

📹 Loom recording if applicable

N/A

🐞 Github Issues solved

N/A

📚 Docs PR if applicable

iterable-docs#1659 (replaces #1658) documents RN SDK 4.1.0 and the Expo plugin Swift Package Manager setup on the RN install page. It covers the Xcode 26+ requirement, removing the pod 'Iterable-iOS-SDK' lines, and moving the Notification Service Extension to the IterableAppExtensions SPM product.

CocoaPods trunk is read-only, so Iterable-iOS-SDK 6.7.5 is the last version
published there. The podspec now uses React Native's spm_dependency helper
(RN 0.75+) to add iterable-swift-sdk to the Pods project, still pinned to
6.7.5 exactly. RNIterableAPI.mm drops the unused IterableSDK.h import, which
the Swift package does not ship. README, example README and CHANGELOG cover
the migration.
@joaodordio
joaodordio requested a review from a team as a code owner December 2, 2026 11:42
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Lines Statements Branches Functions
Coverage: 88%
88.97% (775/871) 77.01% (315/409) 86.86% (238/274)

@qltysh

qltysh Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Qlty


Coverage Impact

This PR will not change total coverage.

Commit 154177c · 🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Xcode 16.4 passes the Swift package product IterableSDK.o to libtool twice
(link file list and explicit input) for the static Iterable-React-Native-SDK
pod, so the archive holds two copies and -ObjC makes the app link fail with
duplicate IterableSDK symbols. Xcode 26.0 and later add it once. Move the
build-ios and CodeQL Swift jobs to Xcode 26.0 and document Xcode 26+.
@joaodordio
joaodordio force-pushed the cursor/spm-dependency-ios-sdk-ad5a branch from de05a5d to bc34871 Compare December 2, 2026 14:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant